package com.meida.module.bus.client.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import lombok.NoArgsConstructor;

/**
 * 订单类型
 *
 * @author gp
 * @date 2021/8/9
 */
@NoArgsConstructor
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@ApiModel("订单类型")
public enum OrderTypeEnum {
    /**
     * 订单类型(1:拍照提问，2:预约辅导，3:作业无忧)
     */
    TakePhotosAskQuestions(1, "拍照提问"),
    BookingTutoring(2, "预约辅导"),
    HomeWork(3, "作业无忧");

    @EnumValue
    private Integer value;
    private String label;

    OrderTypeEnum(Integer value, String label) {
        this.value = value;
        this.label = label;
    }


    public void setValue(Integer value) {
        this.value = value;
    }

    public String getLabel() {
        return label;
    }

    public Integer getValue() {
        return value;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public static OrderTypeEnum getByValue(Integer value) {
        for (OrderTypeEnum orderTypeEnum : values()) {
            if (orderTypeEnum.getValue().equals(value)) {
                return orderTypeEnum;
            }
        }
        return null;
    }
}
